package com.atguigu.eduservice.client;

import com.atguigu.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 视频的远程调用类
 */
@Component
@FeignClient(value = "service-vod",fallback = VodFileDegradeFeignClient.class) // 填入调用服务名称,填入服务器熔断机制触发后调用的类
public interface VodClient {

    @DeleteMapping("/eduvod/video/{videoId}")
    public R deleteVideoById(@PathVariable("videoId") String videoId); // PathVariable一定要指定名称,否则会出错

    @DeleteMapping("/eduvod/video/delete-batch")
    public R deleteVideoList(@RequestParam("videoList") List<String> videoList);
}
